﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Component;
using DevExpress.Xpo;

public partial class FrontEnd_Body_Center_SlideShowIntroduction : System.Web.UI.UserControl
{
    public XPCollection<IntroductionImg> _xpIntroductionImg = new XPCollection<IntroductionImg>(KetNoiCSDL.session);
    public string _IntroductionImg = "";
    public int _pagemaxII = 0;
    public string _Start = "";
    protected void Page_Load(object sender, EventArgs e)
    {
        int idProduct = ConvertType.ToInt(QueryHelper.GetQueryString(Request, ConstString._id));
        _xpIntroductionImg = IntroductionImgDB.GetAll();
        int dem = 0;
        foreach (IntroductionImg img in _xpIntroductionImg)
        {
            if (dem < 4)
                _Start += @"<a id=""aII" + dem + @""" href=""" + "#" + @"""><img src=""" + img.Path + @""" border=""none""/></a>&nbsp;&nbsp;";
            _IntroductionImg += string.Format("{0},{1};", img.Path, img.Path);
            dem++;
        }
        if (_IntroductionImg == "")
            return;
        else
            _IntroductionImg = _IntroductionImg.Substring(0, _IntroductionImg.Length - 1);
        _IntroductionImg += "";
        _pagemaxII = _xpIntroductionImg.Count % 4 == 0 ? (_xpIntroductionImg.Count / 4) : ((_xpIntroductionImg.Count / 4) + 1);
    }
}
